#导包
import jsonschema

#准备校验数据

data = {
    "success": True,
    "code": 10000,
    "message": "操作成功"
}

#对数据进行jsonschema规则

schema ={
    "type":"object",
    "required":["success","code","message"]
}

res = jsonschema.validate(instance=data,schema=schema)
print("res=",res)